/*
 * 
 * 
 * 
 */
package com.hboxs.asl.qcloudLVB.job;

import com.hboxs.asl.qcloudLVB.service.LiveService;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Job - 直播
 */
@Component("liveJob")
@Lazy(false)
public class LiveJob {

    @Resource(name = "liveServiceImpl")
    private LiveService liveService;

    /**
     * 断线直播清除定时器
     * <p>
     * 清除不再推流,但直播状态为在直播中(Live.Status==live,nolive)的直播
     */
    @Scheduled(cron = "${job.live_evict_expired.cron}")
    public void evictExpired() {
        liveService.evictDeadStream();
    }

    /**
     * 断线直播清除定时器
     * <p>
     * 清除不再推流,但直播状态为在直播中(Live.Status==live,nolive)的直播
     */
    @Scheduled(cron = "${job.course_evict_expired.cron}")
    public void evictExpired2() {
        liveService.evictDeadStream2();
    }


}